no matches
$term: string of search term
+'SpecialStatsAddExtra': add extra statistic at the end of Special:Statistics
+&$extraStats: Array to save the new stats
+ ( $extraStats['<name of statistic>'] => <value>; )
+
'SpecialUploadComplete': Called after successfully uploading a file from
Special:Upload
$form: The UploadForm object
}
# Statistic - other
- $text .= $this->getOtherStats();
+ $extraStats = array();
+ if( wfRunHooks( 'SpecialStatsAddExtra', array( &$extraStats ) ) ) {
+ $text .= $this->getOtherStats( $extraStats );
+ }
$text .= Xml::closeElement( 'table' );
return $text;
}
- private function getOtherStats() {
+ private function getOtherStats( $stats ) {
global $wgLang, $wgAllowStatsOther, $wgStatsOther;
- if( !$wgAllowStatsOther ) return;
-
- if ( count( $wgStatsOther ) < 1 ) return;
-
$return = Xml::openElement( 'tr' ) .
Xml::tags( 'th', array( 'colspan' => '2' ), wfMsgExt( 'statistics-header-hooks', array( 'parseinline' ) ) ) .
Xml::closeElement( 'tr' );
- foreach( $wgStatsOther as $name => $number ) {
+ foreach( $stats as $name => $number ) {
$name = htmlspecialchars( $name );
$number = htmlspecialchars( $number );